package com.wangtianxiang.rabbitmq;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.Lifecycle;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

//@Component
public class TestBean implements InitializingBean, Lifecycle, DisposableBean {




    public TestBean() {
        System.out.println("构造器执行 ==================");
    }

    @PostConstruct
    public void init(){
        System.out.println("PostConstruct ======================");
    }


    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("afterPropertiesSet ======================");
    }

    @Override
    public void start() {
        System.out.println("Lifecycle start ============================");
    }

    @Override
    public void stop() {
        System.out.println("Lifecycle stop ============================");
    }

    @Override
    public boolean isRunning() {
        System.out.println("Lifecycle isRunning ============================");
        return false;
    }

    @Override
    public void destroy() throws Exception {
        System.out.println("destroy ======================");
    }
}
